from LAC import LAC
import os


class CutSentence:
    lac = LAC()
    # ################################# #
    # 一批的数量
    # 注意，此值应该和 go_for_cut 中的值一致
    max_batch_size = 100
    # ################################# #

    # 带格式规范地剪切
    def cut_100_sent(self, in_list: list):

        if len(in_list) > self.max_batch_size:
            in_list = in_list[:self.max_batch_size]

        res = self.lac.run(in_list)
        return res

    def ext_cut_100_sent(self, in_list: list, customization_file: str):
        mylac = LAC()
        mylac.load_customization(customization_file=customization_file, sep=' ')

        if len(in_list) > self.max_batch_size:
            in_list = in_list[:self.max_batch_size]

        res = mylac.run(in_list)
        return res
